package cn.changeforyou.devUtils.copy;

import cn.changeforyou.utils.jcommander.BaseParameter;
import cn.changeforyou.utils.validator.AutoValidClose;
import com.beust.jcommander.Parameter;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author zhyu
 * @version 1.0
 * @date 2022-7-15 9:27
 */
@Data
@AutoValidClose
public class Parameters extends BaseParameter {
    @NotNull(groups = {ValidConstant.Copy.class, ValidConstant.RecoveryLog.class, ValidConstant.Recovery.class})
    @Parameter(names = {"-m", "-mode"}, description = "操作模式, copy复制, recovery:恢复, 默认copy", order = 1)
    private Mode mode = Mode.copy;

    @NotBlank(groups = {ValidConstant.Copy.class, ValidConstant.Recovery.class})
    @Parameter(names = {"-s", "-srcPath"}, description = "目标地的文件名或目录名,比如从A复制到B, 这里填A的路径", order = 2)
    private String srcPath;
    @NotBlank(groups = {ValidConstant.Copy.class, ValidConstant.Recovery.class})
    @Parameter(names = {"-t", "-targetPath"}, description = "复制目的地的文件名或者目录名, 比如从A复制到B, 这里填B的路径", order = 3)
    private String targetPath;
    @NotBlank(groups = {ValidConstant.Copy.class, ValidConstant.Recovery.class})
    @Parameter(names = {"-b", "-backupDirectory"}, description = "备份目录, 比如从A复制到B, 这里填备份B和A冲突的文件的路径", order = 4)
    private String backupDirectory;

    @Parameter(names = {"-cl", "-copyLogPath"}, description = "复制日志路径, 在copy操作下, 默认为./, 还原操作为null", order = 5)
    private String copyLogPath;
    @Parameter(names = {"-rl", "-recoveryLogPath"}, description = "还原日志路径, 默认./", order = 6)
    private String recoveryLogPath = "./";

}
